home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 40
/
Vol 40.iso
/
games
/
xmas2004.swf
/
scripts
/
frame_117
/
DoAction.as
Wrap
Text File
|
2007-03-28
|
2KB
|
103 lines
function makePresent()
{
setScore(presentCount++);
attachMovie("mcPresent","mcPresent" + presentCount,presentCount);
var size = 50 + random(100);
this["mcPresent" + presentCount]._xscale = size;
this["mcPresent" + presentCount]._yscale = size;
this["mcPresent" + presentCount]._rotation = random(20) - 10;
var my_color = new Color(this["mcPresent" + presentCount]);
var col = random(7);
if(col == 0)
{
var r = 150;
var g = 0;
var b = 0;
}
else if(col == 1)
{
var r = 0;
var g = 150;
var b = 0;
}
else if(col == 2)
{
var r = 0;
var g = 0;
var b = 150;
}
else if(col == 3)
{
var r = -20;
var g = 100;
var b = 100;
}
else if(col == 4)
{
var r = 150;
var g = 0;
var b = 150;
}
else if(col == 5)
{
var r = 100;
var g = 100;
var b = -10;
}
else if(col == 6)
{
var r = 50;
var g = 50;
var b = 50;
}
var myColorTransform = {ra:100,rb:r,ga:100,gb:g,ba:100,bb:b,aa:100,ab:0};
my_color.setTransform(myColorTransform);
var flip = random(2);
if(flip == 0)
{
this["mcPresent" + presentCount]._xscale = - size - (random(20) - 10);
}
movePressie = 0;
do
{
this["mcPresent" + presentCount]._x = random(500) + 25;
this["mcPresent" + presentCount]._y = random(350) + 25;
var i = 0;
while(i < presentCount)
{
var onAnotherPresent = this["mcPresent" + presentCount].hitTest(this["mcPresent" + i]);
if(onAnotherPresent)
{
break;
}
movePressie++;
if(100 < movePressie)
{
break;
}
i++;
}
}
while(onAnotherPresent);
}
function done()
{
clearInterval(ivDone);
gotoAndStop("hiscore");
}
function timer()
{
var goto = int((getTimer() - startTime) / 10);
mcTimer.gotoAndStop(goto);
if(500 < goto)
{
clearInterval(ivTimer);
}
}
t = 0;
ivDone = setInterval(done,5000);
startTime = getTimer();
ivTimer = setInterval(timer,31);
stop();